package com.xbxkj.api.web.controller;


import org.springframework.web.bind.annotation.RequestMapping;
import com.xbxkj.commen.bean.layuiBean.ResultPage;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ResponseBody;
import com.xbxkj.commen.controller.model.ResultModel;
import com.xbxkj.commen.bean.AdminUserRole;
import java.util.HashMap;
import java.util.List;
    import com.xbxkj.commen.controller.helper.V;
    import com.xbxkj.commen.controller.helper.X;
    import com.xbxkj.commen.controller.model.ResultModel;

import java.util.Map;
    import com.xbxkj.commen.controller.BaseController;

/**
 * <p>
 * 角色用户关联表 前端控制器
 * </p>
 *
 * @author 张子艺
 * @since 2020-01-09
 */
@Controller
@RequestMapping("/admin/adminUserRole")
public class AdminUserRoleController extends BaseController{
     /** 主页面 */
    @RequestMapping("main.html")
    public String main(){
       return  "AdminUserRole/AdminUserRoleMain";
    }
    /** 添加页面跳转
     * @return 返回页面
     */
    @RequestMapping(value = "/addAdminUserRoleHtml")
    public String addAdminUserRoleHtml( ){
             return "AdminUserRole/AdminUserRoleAdd";
    }
    /** 编辑页面跳转
     * @param  id  前端传进的参数
     * @return 返回页面
     */
    @RequestMapping(value = "/editAdminUserRoleHtml")
    public String editAdminUserRoleHtml(String id ,Model model ){
           model.addAttribute("adminUserRole",adminUserRoleService.selectAdminUserRoleByIdAdminUserRole(id));
             return "AdminUserRole/AdminUserRoleEdit";
    }

    /** 查看页面跳转
     * @param  id  前端传进的参数
     * @return 返回页面
     */
    @RequestMapping(value = "/showAdminUserRoleHtml")
    public String showAdminUserRoleHtml(String id ,Model model ){
           model.addAttribute("adminUserRole",adminUserRoleService.selectAdminUserRoleByIdAdminUserRole(id));
             return "AdminUserRole/AdminUserRoleShow";
    }


    /** 分页查询AdminUserRole
     * @param page  页码
     * @param limit  查几条
     * @param adminUserRole  前端传进的参数
     * @return 返回统一分页信息
     */
    @RequestMapping(value = "/findAdminUserRoleByPage")
    @ResponseBody
    public ResultPage findAdminUserRoleByPage(Integer page, Integer limit,AdminUserRole adminUserRole){
             return adminUserRoleService.findAdminUserRoleByPage(page,limit,adminUserRole);
    }

    /** 添加AdminUserRole
     * @param adminUserRole  前端传进的参数
     * @return 返回统一信息
     */
    @RequestMapping(value = "/addAdminUserRole")
    @ResponseBody
    public ResultModel<?> saveAdminUserRole(AdminUserRole adminUserRole  ){
             return adminUserRoleService.addAdminUserRole(adminUserRole);
    }

    /** 编辑AdminUserRole
     * @param adminUserRole  前端传进的参数
     * @return 返回统一信息
     */
    @RequestMapping(value = "/editAdminUserRole")
    @ResponseBody
    public ResultModel<?> editAdminUserRole(AdminUserRole adminUserRole  ){
             return adminUserRoleService.editAdminUserRole(adminUserRole);
    }



    /** 删除一条AdminUserRole
     * @param id  前端传进的ID
     * @return 返回统一信息
     */
    @RequestMapping(value = "/delAdminUserRole")
    @ResponseBody
    public ResultModel<?> delAdminUserRole( String id  ){
             return adminUserRoleService.delAdminUserRole(id);
    }


}
